<#include "/layout/_layout.ftl" /><@head title="首页|四眼井|互联网人的乐园 ">
<link href="${static_domain}/js/jquery-validation/validate.min.css" type="text/css" rel="stylesheet"/>
<link href="${static_domain}/js/powerUI/power-ui.min.css" type="text/css" rel="stylesheet"/>
<link href="${static_domain}/js/areaselect/areaselect.min.css" type="text/css" rel="stylesheet"/>
</@head> <@body 5>
<div class=" clearfix">
	<div class="ui-grid-19">
		<div class="mgl-20">
			<div class="ui-box pd20">
				<form action="/job/create" class="ui-form" method="post" id="add_form">
					<fieldset>
						<div class="ui-form-item">
							<label class="ui-label">标题：</label>
							<input class="ui-input {required:true,maxlength:20}"
							       type="text" name="job.title">
							<span class="ui-form-required">*</span>
						</div>
						<div class="ui-form-item">
							<label class="ui-label">岗位名称：</label>
							<input class="ui-input {required:true,maxlength:10}"
							       type="text" name="job.position">
							<span class="ui-form-required">*</span>
						</div>
						<div class="ui-form-item">
							<label class="ui-label">公司名称：</label>
							<input type="hidden" name="job.firm" class="{required:true}" id="firm">

							<div style="padding-top: 6px">
								<span id="my_firm"></span>
								<a href="/firm/my" class="choose btn-link" rel="" title="请选择公司">选择公司</a>
								<span class="ui-form-required">*</span>
							</div>
						</div>
						<div class="ui-form-item">
							<label class="ui-label">招聘人数：</label>
							<input class="ui-input {required:true,number:true,min:1}"
							       type="text" name="job.numbers">
							<span class="ui-form-required">*</span>
						</div>
						<div class="ui-form-item">
							<label class="ui-label">城市：</label>
							<input type="hidden" name="job.area" class="{required:true}" id="area">

							<div style="padding-top: 6px">
								<span id="job_area_name"></span>
								<a href="#" id="area_select" class="btn-link">选择工作地点</a>
								<span class="ui-form-required">*</span>
								<input type="hidden" name="job.area">
							</div>
						</div>
						<div class="ui-form-item">
							<label class="ui-label">学历要求：</label>
							<select class="ui-select" name="job.education">
								<option value="0">无要求</option>
								<option value="1">大专</option>
								<option value="2">本科</option>
								<option value="3">研究生</option>
								<option value="4">硕士</option>
								<option value="5">博士</option>
							</select>
						</div>
						<div class="ui-form-item">
							<label class="ui-label">工作经验：</label>
							<select class="ui-select" name="job.experience">
								<option value="0">无经验要求</option>
								<option value="1">1~3年</option>
								<option value="2">3~5年</option>
								<option value="3">5~10年</option>
							</select>
						</div>
						<div class="ui-form-item">
							<label class="ui-label">职位类别：</label>
							<select class="ui-select  {required:true}"
							        name="job.type" id="job_type">
								<option value="">请选择职位类别</option>
							</select>
							<span class="ui-form-required">*</span>
						</div>
						<div class="ui-form-item">
							<label class="ui-label">基本薪水：</label>
							<select id="salary" class="ui-select " name="job.salary">
								<option value="0">面谈</option>
								<option value="0000001000">1000元以下</option>
								<option value="0100002000">1000-2000元</option>
								<option value="0200104000">2001-4000元</option>
								<option value="0400106000">4001-6000元</option>
								<option value="0600108000">6001-8000元</option>
								<option value="0800110000">8001-10000元</option>
								<option value="1000115000">10001-15000元</option>
								<option value="1500125000">15000-25000元</option>
								<option value="2500199999">25000元以上</option>
							</select>
						</div>
						<div class="ui-form-item">
							<label class="ui-label">工作性质：</label>
							<select class="ui-select {required:true}"
							        name="job.nature" id="salary">
								<option value="">请选择工作性质</option>
								<option value="全职">全职</option>
								<option value="兼职">兼职</option>
								<option value="实习">实习</option>
							</select>
						</div>
						<div class="ui-form-item">
							<label class="ui-label">要求：</label>
							<textarea id="editor_id" class="" name="job.content"></textarea>
						</div>
						<div class="ui-form-item">
							<input class="btn-g blue" type="submit" value="提交">
						</div>
					</fieldset>
				</form>
			</div>
		</div>
	</div>
	<#--<#include "hot.ftl">-->
</div>
</@body>
<@script>
<script src="${static_domain}/js/kindeditor/kindeditor-min.js"></script>
<script src="${static_domain}/js/jquery-validation/validate.min.js"></script>
<script src="${static_domain}/js/jquery-validation/jquery.metadata.min.js"></script>
<script src="${static_domain}/js/powerUI/powerDialog.min.js"></script>
<script src="${static_domain}/js/areaselect/areaBox.min.js"></script>
<script type="text/javascript">
	KindEditor.ready(function (K) {
		K.create('#editor_id', {
			width: '100%',
			height: 300,
			items: ['bold',
				'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|',
				'justifyleft', 'justifycenter', 'justifyright',
				'justifyfull', 'insertorderedlist', 'insertunorderedlist',
				'indent', 'outdent', 'subscript',
				'superscript', 'clearhtml', 'quickformat', '|' , 'source', 'code',
				'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'image',
				'flash', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
				'anchor', 'link', 'unlink']
		});
	});

	$(function () {
		$("#add_form").validate({
			onkeyup: false,
			debug: true,
			submitHandler: function (form) {
				if ($('#firm').val() == '') {
					alert('请选择公司');
					return false;
				}
				if ($('#area').val() == '') {
					alert('请选择工作地点');
					return false;
				}
				form.submit();
			}
		});

		$.get('/job/type', function (data) {
			$.each(data.type, function (n, d) {
				$('#job_type').append('<option value="' + d.id + '">' + d.name + '</option>')
			})
		});

		$('#area_select').areaBox(function (_id, _name) {
			$('#job_area_name').html(_name);
			$('input[name="job.area"]').val(_id);
		});
		$('.choose').powerDialog();
	});
	function addFirm(_id, _name) {
		$('input[name="job.firm"]').val(_id);
		$('#my_firm').html(_name);
	}
</script>
</@script>